<h2>ผลตอบแทน</h2>
<table style="width: 100%;">
    <?php
        $query="
            select  *
            from    cost_afphase
            ";
        $result=  mysql_query($query) or die(mysql_error());
        $numrows=  $result->num_rows;
        $i=0;
        while($i<$numrows){
            $row=  $result->fetch_array(MYSQLI_ASSOC);
            ?>
    <tr>
        <td colspan="2"><?=$row["cafpName"]?></td>
    </tr>
    <tr>
        <td style="padding-bottom: 10px">
            <div class="input-group">
                <span class="input-group-addon" style="width: 70px;">จำนวน</span>
                <input type="tel" name="amount[]" class="form-control">
                <span class="input-group-addon">กก.</span>
            </div>
        </td>

        <td style="padding-bottom: 10px">
            <div class="input-group">
                <span class="input-group-addon" style="width: 70px;">ราคาขาย</span>
                <input type="tel" name="price[]" class="form-control">
                <span class="input-group-addon">บาท/กก.</span>
            </div>
        </td>        
    </tr>
                <?php
            $costCount=0;
            $i++;
        }
    ?>
</table>
<?php
    if($phaseID+1>$maxPhaseID){
        ?>
<input type="submit" value="กลับไปหน้า ต้นทุนทั่วไป" class="btn btn-default" style="float: right;"
       onclick="window.open('.?page=costGeneral','_self')"
       >
            <?php
    }else{
        ?>
<input type="submit" value="ต่อไป > " class="btn btn-default" style="float: right;"
       onclick="window.open('.?page=costPhase&phaseID=<?=$phaseID+1?>','_self')"
       >
            <?php
    }
?>